home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11227 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: soap.news.pipex.net!pipex!usenet
  2. From: Dirk Wessels <dirk@oxigen.demon.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Will JAVA kill C++?
  5. Date: 13 Mar 1996 10:40:24 GMT
  6. Organization: UnipalmPIPEX server (post doesn't reflect views of UnipalmPIPEX)
  7. Message-ID: <4i68mo$ajp@soap.news.pipex.net>
  8. References: <31426210.1244@bhp.com.au> <1996Mar12.155442.1839@amc.com> <31462922.21F4A8BD@netcom.com>
  9. NNTP-Posting-Host: aj156.du.pipex.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1 (Windows; I; 16bit)
  14.  
  15. Adam Megacz <kalessin@netcom.com> wrote:
  16. >Curtis Green wrote:
  17. >
  18. >> code reliablity is more a function of programmer ability than language
  19. >> features.  I agree that C++ is woefully missing garbage collection but
  20. >> you can pick up class libraries with those features.  A lousy programmer can
  21. >> write lousy programs in any language.
  22. >
  23. >Amen. Also, I believe that every feature in Java can be had in C++
  24. >merely by adding class libraries and choosing not to use pointers. As
  25. >for the bytecode stuff, ANDF works just fine for C++. Does anyone know
  26. >of a feature in Java that C++ can't do (w/o some extra source code)? I'd
  27. >like to know!
  28. >
  29.  
  30. I think you are both missing the point here.
  31. Java works with references, just like Delphi and Smalltalk.
  32. C++ works with actual addresses, which do not necessary point to
  33. objects but also to strings, booleans or start of an array.
  34. Since any addess may point to something unknown, you can not have
  35. safe garbage collection. 
  36. The only thing to perform garbage collection in C++ is to use classes
  37. that handle the references instead of pointers. This is much slower, 
  38. can still easily be misused. And are often not fully functional 
  39. (reference counting).
  40. Garbage collecting is as good in C++ as in C and Assembler!!
  41.  
  42. I made a few garbage collectors in C++ myself. 
  43. Try it yourself ... and then let other people use it...
  44.  
  45.  
  46. Good luck
  47.  
  48. Dirk Wessels
  49.  
  50.  
  51.